package edu.udlap.spring2008.is300.finalexam.app.mvc.model.database.filters;

import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.filters.ImageRecordFilter;
import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.filters.ImageRecordFilterDecorator;

/**
 *
 * @author Ruslán Ledesma Garza
 */
public class AppImageRecordFilterDescription extends ImageRecordFilterDecorator
{   
    
    public AppImageRecordFilterDescription(ImageRecordFilter imageRecordFilter,
            String description, boolean isNegated)
    {
        decoratedImageRecordFilter_ = imageRecordFilter;
        filterValue_ = description;
        isNegated_ = isNegated;
    }

    @Override
    protected String getSqlConstraints_()
    {
        return "\"DESCRIPTION\" " +
                (isNegated_ ? "NOT " : "") +
                "LIKE '%" + filterValue_ + "%'";
    }
    
}